﻿using Prices;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace Prices.Test
{
    [TestClass()]
    public class ProductTest
    {
        [TestMethod()]
        public void ProductConstructorTest()
        {
            string name = "neshto";
            int price = 12;
            Product target = new Product(name, price);
            Assert.AreEqual(name, target.Name);
            Assert.AreEqual(price, target.Price);
        }

        [TestMethod()]
        [DeploymentItem("Prices.exe")]
        public void OnPriceIncreaseTest()
        {
            Product_Accessor target = new Product_Accessor("neshto", 12);
            int newPrice = 25;
            target.priceIncreased += new PriceIncreasedEventHandler(Prices_Accessor.PriceIncreased);
            target.Price = newPrice;
            Assert.AreEqual(newPrice, target.Price);
        }
    }
}
